<UserControl x:Class="Bifrost.Mimir.Features.General.Pivot.View"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Bifrost.Mimir.Features.General.Pivot" mc:Ignorable="d"
			 d:DesignHeight="300" 
			 d:DesignWidth="400"
             xmlns:pivot="clr-namespace:System.Windows.Controls.Pivot;assembly=System.Windows.Controls.Pivot"
             DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=Pivot}"
             >
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>


        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Button Content="Republish" Command="{Binding RepublishFilteredCommand}"/>
            <Button Content="Reload" Command="{Binding ReloadCommand}" Click="Button_Click"/>
        </StackPanel>



        <pivot:PivotViewer x:Name="_pivotViewer" Grid.Row="1" ItemsSource="{Binding Events}">
            <pivot:PivotViewer.ItemTemplates>
                <pivot:PivotViewerItemTemplate>
                    <StackPanel Orientation="Vertical">

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="64"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <Image Source="/Bifrost.Mimir;component/Features/General/Pivot/Event.png" Grid.Column="0"/>
                            <TextBlock FontSize="64" Text="{Binding LogicalEventName}" Grid.Column="1"/>
                        </Grid>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="32"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <Image Source="/Bifrost.Mimir;component/Features/General/Pivot/Occured.png" Grid.Column="0"/>
                            <TextBlock FontSize="32" Text="{Binding Occured}" Grid.Column="1"/>
                        </Grid>
                    </StackPanel>
                </pivot:PivotViewerItemTemplate>
            </pivot:PivotViewer.ItemTemplates>

            <pivot:PivotViewer.PivotProperties>
                <pivot:PivotViewerStringProperty Id="Command" Options="CanFilter" Binding="{Binding CommandName}"/>
                <pivot:PivotViewerStringProperty Id="Event" Options="CanFilter" Binding="{Binding LogicalEventName}"/>
                <pivot:PivotViewerStringProperty Id="AggregatedRoot" Options="CanFilter" Binding="{Binding AggregatedRoot}"/>
                <pivot:PivotViewerStringProperty Id="Aggregated Id" Options="CanFilter" Binding="{Binding AggregatedId}"/>
                <pivot:PivotViewerDateTimeProperty Id="Occured" Options="CanFilter" Binding="{Binding Occured}"/>
            </pivot:PivotViewer.PivotProperties>
            
        </pivot:PivotViewer>
    </Grid>
</UserControl>
